cmake_minimum_required(VERSION 3.17)
project(asio_net)
if (MSVC_VERSION GREATER_EQUAL "1900")
    include(CheckCXXCompilerFlag)
    CHECK_CXX_COMPILER_FLAG("/std:c++latest" _cpp_latest_flag_supported)
    if (_cpp_latest_flag_supported)
        add_compile_options("/std:c++latest")
    endif()
endif()
# lib
set(ASIO_CMAKE_ASIO_TAG asio-1-18-2)
add_subdirectory(3rd/asio-dep)
include_directories(3rd/asio-dep)
add_subdirectory(net-common)
include_directories(net-common)
add_subdirectory(3rd/protobuf/cmake)
include_directories(3rd/protobuf/src)

# find_package(Protobuf REQUIRED)

# source
add_subdirectory(test)
add_subdirectory(net-server)
add_subdirectory(net-client)
# add_executable(${PROJECT_NAME} main.cpp)

# target_link_libraries(${PROJECT_NAME} PRIVATE asio)
# target_link_libraries(${PROJECT_NAME} PRIVATE net-common)